'''
Created on 11/01/2014

@author: JESUS ALBERTO GOMEZ
'''
import urllib2
import prueba
import process_html

types = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]
pos_list = []

n= 0
for type in types:
    pos_list.append('tipo='+str(type))
    n= n+1

out = open('comidas.txt','w+')

url_prefix = "http://www.recetas.net/sabermas/saber_nutricional.asp?"

for url_pos in pos_list:
    url = url_prefix + url_pos
    usock = urllib2.urlopen(url);
    data = usock.read()
    
    process_html.process_html(data,out)
    
out.close()
usock.close()